.head
  = raw step(@runseq.form_step, @xvars[:total_form_steps])
- if File.exists?(@f_help)
  %span(style='float:right;padding-right: 20px;')
    = link_to "วิธีกรอกแบบ", {:controller=>"engine", :action=>"help", :f=>@f_help}, :target=>"_blank"
    &nbsp;
- if GMAP
  %script(src='http://maps.google.com/maps/api/js?sensor=false')
/= stylesheet_link_tag 'jquery.autocomplete'
%script
  function validate() { return true; }
/= javascript_include_tag "jquery.ui.core"
/= javascript_include_tag "jquery.ui.widget"
/= javascript_include_tag "jquery.ui.position"
/= javascript_include_tag "jquery.ui.autocomplete"
= javascript_include_tag "disable_enter_key"
/= stylesheet_link_tag "jquery.ui","jquery.ui.autocomplete"

%p
- user = current_user || User.new
- form_class = 'formtastic'
- next_step = 'end_form'
= form_tag({ :action => next_step } , {:multipart => true, :onSubmit=>'return validate()', :class=>form_class, "data-ajax"=>"#{ajax?(@ui)}"}) do
  = hidden_field_tag 'xmain_id', @xmain.id
  = hidden_field_tag 'ajax', ajax?(@ui)
  = hidden_field_tag 'runseq_id', @runseq.id
  = hidden_field_tag 'step', @xvars[:current_step]
  = render :inline=> @ui
  %p
  = submit_tag @message
%p
:javascript
  $(function() {
    //$('td input')[3].focus();
    $('.required').append('<span style="color:red"> *</span>');
    $('.refresh').append(" <img src='/images/refresh.png'/>");
  })
